package cn.blunce.weather.utils;

/**
 * Created by Experiment on 2016/4/20 0020.
 */
public class Urls {
    private static final String API_KEY = "&key=60fcdc1f08314af8b7ef37f85b4b40bd";

    public static final int URL_INDEX_WEATHER_IDS = 0;
    public static final int URL_INDEX_CITY_IDS = 1;
    public static final int URL_INDEX_SEARCH_WEATHER = 2;
    public static final int URL_INDEX_DOWNLOAD_WEATHER_PHOTO = 3;


    public static String getUrl(int index, String para) {
        switch (index) {
            case URL_INDEX_CITY_IDS:
                return "https://api.heweather.com/x3/condition?search=allcond" + API_KEY;
            case URL_INDEX_WEATHER_IDS:
                return "https://api.heweather.com/x3/citylist?search=allchina" + API_KEY;
            case URL_INDEX_SEARCH_WEATHER:
                return "https://api.heweather.com/x3/weather?cityid=" + para + API_KEY;
            case URL_INDEX_DOWNLOAD_WEATHER_PHOTO:
                return "http://files.heweather.com/cond_icon/" + para + ".png";
            default:
                return null;
        }
    }
}
